package com.example.win.android_banduyujia.lib.util;

import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

/**
 * Created by huchun on 2015/8/12.
 *  关闭系统的软键盘
 */
public class SoftKeyboardUtil {

    public static void dismissSoftKeyboard(Activity  activity){
        View view= activity.getWindow().peekDecorView();
        if(view !=null){
            InputMethodManager  inputMethodManager = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);

            inputMethodManager.hideSoftInputFromInputMethod(view.getWindowToken(), 0);
        }
    }
}
